Public Partial Class FrmListarDetalleOrdenDePago
    Inherits System.Web.UI.Page
    Dim IdOrden As String
    Public DetalleOrdenDePago As CapaDeNegocios.nDetalleOrdenDePago = New CapaDeNegocios.nDetalleOrdenDePago
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Session("Login") = "Anonimo" Then
            Response.Redirect("/")
        End If
        If Not Page.IsPostBack Then
            IdOrden = Request.QueryString("IDOrden")
            HfOP.Value = IdOrden
            'IdOrden = 11
            If IdOrden <> "" Then
                LlenarCuerpo()
            End If
        End If
    End Sub
    Sub LlenarCuerpo()
        GridDetalle.DataSource = DetalleOrdenDePago.BuscarFiltrado("", "", "", HfOP.Value.ToString())
        GridDetalle.DataBind()
    End Sub

    Protected Sub GridDetalle_RowDataBound(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridDetalle.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim a As LinkButton = e.Row.FindControl("LnkSeleccion")
            Dim b As HiddenField = e.Row.FindControl("HFFactura")
            a.OnClientClick = "javascript:var popup = window.open('FrmDetalleDeFacturaCompra.aspx?IDFactura=" + b.Value.ToString() + "',(new Date().getTime()),'Width=700,Height=500,Scrollbars=NO,Resizable=NO,Location=NO,Menubar=NO,Status=NO,Titlebar=NO,Toolbar=NO')"
        End If

    End Sub

    Protected Sub GridDetalle_PageIndexChanging(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridDetalle.PageIndexChanging
        GridDetalle.PageIndex = e.NewPageIndex
        LlenarCuerpo()

    End Sub
End Class